<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>vue</title>
  <script src="./js/vue.js"></script>
</head>

<body>
  <div id="app">
    <div>
      <!-- 延时更新数据,当光标失去焦点时，更新数据  lazy -->
      <!-- 去除两端空格 -->
      <input type="text" v-model.lazy.trim="title">
    </div>

    <!-- 转为数值 -->
    <input type="number" v-model.number="n1">+<input type="number" v-model.number="n2"> = {{n1+n2}}

  </div>

  <script>

    new Vue({
      el: '#app',
      data: {
        title: '',
        n2: 2,
        n1: 1
      }
    })
  </script>
</body>

</html>